﻿/*
Copyright (c) 2010 Lance Ward
This software is licensed under the MIT license, except where otherwise noted.
For complete license details, refer to license.txt
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Drawing;

namespace ADNColorPicker
{
	public class PalColor
	{
		private string description = String.Empty;
		private int a = 0;
		private int r = 0;
		private int g = 0;
		private int b = 0;

		public PalColor(int a, int r, int g, int b)
		{
			this.a = a;
			this.r = r;
			this.g = g;
			this.b = b;
		}

		[XmlAttribute]
		public string Description
		{
			get
			{
				return description;
			}
			set
			{
				description = value;
			}
		}

		[XmlAttribute]
		public int A
		{
			get
			{
				return a;
			}
			set
			{
				a = value;
			}
		}

		[XmlAttribute]
		public int R
		{
			get
			{
				return r;
			}
			set
			{
				r = value;
			}
		}

		[XmlAttribute]
		public int G
		{
			get
			{
				return g;
			}
			set
			{
				g = value;
			}
		}

		[XmlAttribute]
		public int B
		{
			get
			{
				return b;
			}
			set
			{
				b = value;
			}
		}

		public Color ToColor()
		{
			return Color.FromArgb(a, r, g, b);
		}
	}
}
